package com.tanhua.server.controller;

import com.tanhua.autoconfig.template.HuanXinTemplate;
import com.tanhua.commons.utils.Constants;
import com.tanhua.model.vo.HuanXinUserVo;
import com.tanhua.server.interceptor.UserHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/huanxin")
public class HuanxinController {


    @Autowired
    private HuanXinTemplate template;

    /*
     *  环信用户信息
     *    请求方式和请求链接 : GET  /user
     *    请求参数:
     *    返回值: username ,password
     * */
    @GetMapping("/user")
    public ResponseEntity user() {
        HuanXinUserVo vo = new HuanXinUserVo();
        vo.setUsername(Constants.HX_USER_PREFIX + UserHolder.getUserId());
        vo.setPassword(Constants.INIT_PASSWORD);

        return ResponseEntity.ok(vo);

    }

}
